#include "GUI/gui.hpp"

GUI::GUI():Listener("GUI"), m_guiImpl(NULL)
{
#ifdef GTK
	GUIFactory* factory = GtkFactory::GetFactoryInstance();
#endif

#ifdef SHELL
	GUIFactory* factory = ShellFactory::GetFactoryInstance();
#endif
	if(factory)
		m_guiImpl = factory ->MakeGUI();
}

int GUI::Init(int argc, char** argv)
{
	if(m_guiImpl)
		return m_guiImpl ->Init(argc, argv);
	return -1;
}

int GUI::CreateUI()
{
	if(m_guiImpl)
		return m_guiImpl ->CreateWindow();
	return -1;
}

int GUI::MainLoop()
{
	if(m_guiImpl)
		return m_guiImpl->MainLoop();
	return -1;
}

void GUI::Update(Image& image)
{
	if(m_guiImpl)
		return m_guiImpl->Update(image);
}

void GUI::DoEvents(int s)
{
	if(m_guiImpl)
		return m_guiImpl->DoEvents(s);
}
